#include <bits/stdc++.h>
using namespace std;
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
using ll = long long;
void solve()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    vector<int> ans(n);
    int l = 1, r = n;
    for (int i = n - 1; i > 0; --i)
    {
        if (s[i - 1] == '<')
            ans[i] = l++;
        else
            ans[i] = r--;
    }
    ans[0] = l;
    for (int i = 0; i < n; ++i)
        cout << ans[i] << ' ';
    cout << '\n';
}
int main()
{
    int t = 1;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
